﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Tebbee.Business.Server.Model;

namespace Tebbee.Business.Server
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IAccountSer" in both code and config file together.
    [ServiceContract]
    public interface IAccountSer
    {
        // Member Function
        [OperationContract]
        ICollection<Member_All_Result> AllMembers();
        [OperationContract]
        Member_ChangeAvatar_Result ChangeAvatar(string userName, string type);
        [OperationContract]
        ICollection<Member_List_Result> ListMembers(int startRow, string searchString);
        [OperationContract]
        int AddNewMember(MemberFull mem, out string msg);
        [OperationContract]
        int EditProfilesMember(MemberFull mem, out string msg);
        [OperationContract]
        int EditFullProfilesMember(MemberFull mem, out string msg);
        [OperationContract]
        int DeleteMember(int memId);
        [OperationContract]
        int RemoveSubcribe(int subId);
        [OperationContract]
        ICollection<Member_SubcribeList_Result> GetSubcribeList(string userName, int currentPage, out int totalPage);
        [OperationContract]
        ICollection<Member_PointList_Result> GetPointList(string userName, int currentPage, out int totalPage);
        //[OperationContract]
        //ICollection<Member_ExchangeLog_Result> GetExchangeLog(string userName, int currentPage, out int totalPage);
        [OperationContract]
        Member_GetByUserName_Result GetMemberByUserName(string userName);
        [OperationContract]
        Member_GetByMemId_Result GetMemberById(int memId);


        // Publisher Function
        [OperationContract]
        ICollection<Publisher_All_Result> AllPublishers();
        [OperationContract]
        ICollection<Publisher_List_Result> ListPublishers(int startRow, string searchString);
        [OperationContract]
        int AddNewPublisher(PublisherFull pub, out string msg);
        [OperationContract]
        int EditProfilesPublisher(PublisherFull pub, out string msg);
        [OperationContract]
        int PublisherRegPackage(int pubId, DateTime availableDate, DateTime expriedDate);
        [OperationContract]
        int DeletePublisher(int pubId);
        
        // Admin Function

        [OperationContract]
        ICollection<Admin_ALL_Result> AllAdmin();
        [OperationContract]
        ICollection<Admin_List_Result> ListAdmin(int startRow, string searchString);
        [OperationContract]
        int AddNewAdmin(AdminFull admin, out string msg);
        [OperationContract]
        int DeleteAdmin(int adId);

        // Authen function
        [OperationContract]
        bool Login(string uid, string pwd, out string msg);
        [OperationContract]
        bool ChangePwd(ChangePassModel user, out string msg);
        [OperationContract]
        int ResetPassword(string userName);
    }
}
